package com.hnzq.cloud.sendassembly.exception;


import com.hnzq.cloud.model.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class FreExceptionHandler {



    //父异常
    @ExceptionHandler(FreException.class)
    public Result DefectTrackingException(FreException e){
        return Result.newInstance().setMessage(e.getMessage()).setCode(e.getCode());
    }
    @ExceptionHandler(Exception.class)
    public Result Exception(Exception e){
        e.printStackTrace();
        return Result.newInstance().setMessage("有异常").setCode(500);
    }
}
